<?php
use backend\models\Brand;
use yii\bootstrap\Html;
use yii\data\Pagination;
use yii\helpers\Url;
use yii\widgets\LinkPager;

$this->title= "添加品牌";
$this->params['breadcrumbs'][]= ['label'=>\Yii::$app->controller->id,'url'=>['brand/index']];
$this->params['breadcrumbs'][] = ['label'=>$this->title,'url'=>['brand/add']];
$this->params['breadcrumbs'][] = ['label'=>'回收站','url'=>['brand/recycle-bin']];


?>
<div class="container table-responsive ">
<table class="table  table-hover">
    <tr>
        <th>商品品牌名称</th>
        <th>品牌LOGO</th>
        <th>品牌排序</th>
        <th>商品品牌状态</th>
        <th>品牌操作</th>
    </tr>
    <?php   foreach($models as $model):?>
    <tr>
        <td><?=$model->name?></td>
        <td><?=Html::img($model->imgsrc,['class'=>'img-circle','width'=>'50px'])?></td>
        <td><?=$model->sort?></td>
        <td><?=Brand::$statusInfo[$model->status]?></td>
        <td>
            <?=Html::beginTag('div',['class'=>'btn-group'])?>
            <?=Html::a('编辑',Url::to(['brand/edit','id'=>$model->id]),['class'=>'btn btn-warning'])?>
            <?=Html::a('删除',Url::to(['brand/del','id'=>$model->id]),[
                    'class'=>'btn btn-danger',
                    'data'=>[
                            'confirm'=>"确定删除吗?",
                        'method'=>'post',
                    ],
            ]);?>
            <?=Html::a('查看',Url::to(['brand/show','id'=>$model->id]),['class'=>'btn btn-info']);?>
            <?=Html::endTag('div')?>
        </td>
    </tr>
    <?php endforeach;?>
</table>
</div>

<?php

echo LinkPager::widget([
        'pagination'=>$pager,
        'nextPageLabel'=>'下一页',
        'prevPageLabel'=>'上一页',
]);

